<ui:fragment xmlns="http://w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:virtual="http://virtual.servidor">


	<p:outputPanel layout="block" id="frete">



		<p:outputPanel layout="block" id="frete-calcular">
	
			<div class="row-fluid margin-bottom">
				<h:outputText value="Calcule o valor do frete e o prazo de entrega para seu
					endereço" styleClass="font-bold"/>
			</div>
			
			<div class="row-fluid">
				<div class="span2 div-lbl-tipo-frete">
					<h:outputText value="Tipo de Entrega: " />
				</div>
				<div class="span10 div-rdo-frete">
					<p:selectOneRadio value="#{carrinhoMB.tipoFrete}"
						styleClass="radio-frete">
						<f:selectItems value="#{carrinhoMB.getListTipoFrete()}" var="tf"
							itemLabel="#{tf.nome}" itemValue="#{tf}" />
					</p:selectOneRadio>
				</div>
			</div>

			<div class="row-fluid">
				<div class="span2 div-lbl-tipo-frete">
					<p:outputLabel value="CEP:" />
				</div>
				<div class="span2 inline-block" >
					<p:inputMask mask="99999-999" value="#{carrinhoMB.cepDestino}" styleClass="input-cep" />
				</div>
				<div class="inline-block">
					<p:commandLink value="Calcular" styleClass="btn-virtual btn-calc-frete" 
						actionListener="#{carrinhoMB.calculaFrete(produto)}" ajax="true"
						update="frete" />
				</div>
			</div>
		</p:outputPanel>

		<p:outputPanel layout="block" id="frete-calculado" rendered="#{carrinhoMB.isFreteCalculavel()}">
			<div class="row-fluid">
				<h:outputText value="O valor do frete (#{carrinhoMB.tipoFrete}) para o cep #{carrinhoMB.cepDestino} é de " />
				<h:outputText value="#{frete.valor}" styleClass="font-bold">
					<f:convertNumber type="currency" />
				</h:outputText>
				<h:outputText value=" e será entregue no prazo de"></h:outputText>
				<h:outputText value=" #{frete.prazoEntrega} dia(s)." styleClass="font-bold"/>
			</div>
		</p:outputPanel>
	</p:outputPanel>
</ui:fragment>